<template>
  <div>
    <NavbarTop>
      <img slot="left" class="NavbarTop-left" src="@/assets/images/1.jpg" alt />
      <span slot="center" class="NavbarTop-center">
        <div class="ipt">
          <van-icon name="search" />
          <span>请输入您要搜索的内容</span>
        </div>
      </span>
      <span slot="right" class="NavbarTop-right">
        <img src="@/assets/images/2.jpeg" alt />
        <van-button color="linear-gradient(to right, #4bb0ff, #6149f6)">下载App</van-button>
      </span>
    </NavbarTop>
    <div class="userDetail">
      <img class="userDetail-top" src="@/assets/images/4.jpg" alt="">
      <UserDetail></UserDetail>
    </div>
  </div>
</template>

<script>
import NavbarTop from '@/components/common/NavbarTop'
import UserDetail from '@/components/userdetail/UserDetail'
export default {
  components: {
    NavbarTop,
    UserDetail
  },
  data() {
    return {

    }
  },
  created() {
    this.getuserinfo()
  },
  methods: {
    async getuserinfo() {
      const res = await this.$http.get('/api/user/' + JSON.parse(sessionStorage.getItem('userinfo')).id, {
        headers: {
          'Anthorization': 'Bearer ' + JSON.parse(sessionStorage.getItem('userinfo')).token
        }
      })
      console.log(res, '获取个人信息')
    }
  }
}
</script>

<style lang="less" scoped>
.userDetail {
  .userDetail-top {
    display: block;
    height: 200px;
    width: 100%;
  }
}
</style>